package misp_backend.mapper;

import misp_backend.domain.Package;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import misp_backend.domain.PackageDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author yang
* @description 针对表【package】的数据库操作Mapper
* @createDate 2025-03-19 23:53:29
* @Entity generator.domain.Package
*/
@Mapper
public interface PackageMapper extends BaseMapper<Package> {
    @Select("SELECT d.dish_id, d.dish_name, d.price, pd.quantity " +
            "FROM packagedetails pd " +
            "JOIN dishes d ON pd.dish_id = d.dish_id " +
            "WHERE pd.package_id = #{packageId}")
    List<PackageDTO.PackageDishDTO> selectPackageDishes(Long packageId);
}




